
      var svgdoc,svgroot;


      function getSVGDoc(load_evt)
      {
        svgdoc=load_evt.getTarget().getOwnerDocument();
        svgroot=svgdoc.getDocumentElement();
      }


      function ShowTooltip(DisplayTxt, mousemove_event)
      {
        var ttrelem,tttelem,posx,posy,curtrans,ctx,cty,txt;

        ttrelem=svgdoc.getElementById("ttr");
        tttelem=svgdoc.getElementById("ttt");

        posx=mousemove_event.getClientX();
        posy=mousemove_event.getClientY();


        txt=DisplayTxt;
        tttelem.childNodes.item(0).setData(txt);

        curtrans=svgroot.getCurrentTranslate();
        ctx=curtrans.getX();
        cty=curtrans.getY();


        ttrelem.setAttribute("x",posx-ctx);
        ttrelem.setAttribute("y",posy-cty-20);
        tttelem.setAttribute("x",posx-ctx+5);
        tttelem.setAttribute("y",posy-cty-8);
        ttrelem.setAttribute("width",tttelem.getComputedTextLength()+10);
        tttelem.setAttribute("style","fill: darkred; font-size: 11px; visibility: visible");
        ttrelem.setAttribute("style","fill: lightblue; stroke: #000; stroke-width: 0.5px;\
          visibility: visible");
      }


      function HideTooltip()
      {
        var ttrelem,tttelem;

        ttrelem=svgdoc.getElementById("ttr");
        tttelem=svgdoc.getElementById("ttt");
        ttrelem.setAttribute("style","visibility: hidden");
        tttelem.setAttribute("style","visibility: hidden");
      }


      function TooltipZoomControl()
      {
        var curzoom;

        curzoom=svgroot.getCurrentScale();
        svgdoc.getElementById("tooltip").setAttribute("transform","scale("+1/curzoom+")");
      }



